Integrating Yandex mediation

Warning

Make sure to update your used Yandex mobile mediation adapters and adapters for third-party mediation networks to the latest version. Older versions may cause adapter integration errors that can prevent your ads from being served.

Yandex Mediation is a platform that automatically selects ads from a variety of networks using ML algorithms to maximize your revenue. All settings are turnkey, meaning there's no need to debug each network separately. If you previously used the Mobile Ads SDK with only one Yandex network, you won't need to change anything in the code to switch to Yandex mediation. You only need to pre-configure the units in the web interface of external ad networks.

Mobile Ads Unity is a plugin for the Unity3d game platform that supports the Yandex Mobile Ads SDK.

Preliminary setup

To prepare your app, follow the steps from the next sections.

App requirements

  • To run the SDK, you need Target API Level version 31 or higher.
  • To load ads of any type, you need iOS 13 or later.
  • Use Xcode 15 or higher.

Set up the application in your Yandex Advertising Network account

Here's how to register your app in the Yandex Advertising Network:

  1. Log in or register your account in the Yandex Advertising Network.
  2. Register your app in the Yandex Advertising Network.

Integration

Warning

yandex-ads-unity-plugin runs only in Android and iOS environments. The Unity editor does not currently support loading or showing ads.

There are two ways to enable mobile mediation:

  • Unified build (recommended): All available adapters are added automatically.
  • Adding adapters individually: Yandex SDK is installed with the lite package, with individual adapters added one by one using the appropriate packages.

You can automatically enable all available adapters using the yandex-mobileads-mediation general mediation package.

  1. Set up mediation in the Yandex Partner interface.

  2. Download the yandex-ads-unity-plugin directory and add the yandex-mobileads-mediation-7.0.1.unitypackage package. You will be prompted to install Google resolver with it. If Google resolver was already added to your project, clear the checkbox.

    How to add a package

    Select a plugin (Assets → Import Package → Custom Package), then click Import.

  3. Use Google's resolver to set dependencies: enable auto-resolve or select Assets → External Dependency Manager → Android Resolver → Resolve in the menu.

  4. To test the Mobile Ads Unity plugin, use a sample script from the samples directory in the yandex-ads-unity-plugin repository. Copy the script to the project directory and add it as a Component to the main camera.

  5. Additional setting for the Google AdMob (ex. AdMob) network. Create the main AndroidManifest.xml file using File → Build Settings → Android → Player Settings → Publishing Settings → Custom Main Manifest (check the box).

    Add your Google AdMob (ex. AdMob) ID to the AndroidManifest.xml file created for your app using the <meta-data> tag named com.google.android.gms.ads.APPLICATION_ID (here's how to find your AdMob ID).

    <manifest>
        <application>
    <!--...-->
            <meta-data
                android:name="com.google.android.gms.ads.APPLICATION_ID"
                android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
    <!--...-->
        </application>
    </manifest>
    

To add individual adapters, add yandex-mobileads-lite-x.x.x.unitypackage and relevant adapters by following the instructions:

  1. Set up mediation in the Yandex Partner interface.

  2. Download the directory yandex-ads-unity-plugin and add the package yandex-mobileads-lite-7.0.1.unitypackage. You will be prompted to install Google resolver with it. If Google resolver was already added to your project, clear the checkbox.

    How to add a package

    Select a plugin (Assets → Import Package → Custom Package), then click Import.

  3. Use Google's resolver to set dependencies: enable auto-resolve or select Assets → External Dependency Manager → Android Resolver → Resolve in the menu.

  4. To test the Mobile Ads Unity plugin, use a sample script from the samples directory in the yandex-ads-unity-plugin repository. Copy the script to the project directory and add it as a Component to the main camera.

  5. Add the applicable adapters one by one using the appropriate packages.